/**
 * @description: 站点
 */

import { defHttp } from '../http'
import type { CommonAPI } from '../schema/all'
/** 查询站点列表 */
export const getApiSiteListApi: CommonAPI<'/api/site/query', 'get'> = (
  params
) => defHttp.get(`/api/site/query`, { params })

/** 查询站点 */
export const getApiSiteApi: CommonAPI<'/api/site', 'get'> = (params) =>
  defHttp.get(`/api/site`, { params })

/** 更新站点基本信息 */
export const updateApiSiteApi: CommonAPI<'/api/site', 'put'> = (data) =>
  defHttp.put(`/api/site`, { data })

/** 创建站点 */
export const addApiSiteApi: CommonAPI<'/api/site', 'post'> = (data) =>
  defHttp.post(`/api/site`, { data })

/** 删除站点 */
export const deleteApiSiteApi: CommonAPI<'/api/site', 'delete'> = (params) =>
  defHttp.delete(`/api/site`, { params })

/** 批量更新站点组 */
export const updateApiSiteBatchUpdateGroupApi: CommonAPI<
  '/api/site/batch-update-group',
  'put'
> = (data) => defHttp.put(`/api/site/batch-update-group`, { data })

/** 批量更新站点区域 */
export const updateApiSiteBatchUpdateRegionApi: CommonAPI<
  '/api/site/batch-update-region',
  'put'
> = (data) => defHttp.put(`/api/site/batch-update-region`, { data })

/** 获取站点缓存配置 */
export const getApiSiteCacheConfigApi: CommonAPI<
  '/api/site/cache-config',
  'get'
> = (params) => defHttp.get(`/api/site/cache-config`, { params })

/** 更新站点缓存配置 */
export const updateApiSiteCacheConfigApi: CommonAPI<
  '/api/site/cache-config',
  'put'
> = (data) => defHttp.put(`/api/site/cache-config`, { data })

/** 获取站点回源信息 */
export const getApiSiteOriginServerDetailApi: CommonAPI<
  '/api/site/origin-server',
  'get'
> = (params) => defHttp.get(`/api/site/origin-server`, { params })

/** 更新站点回源信息 */
export const updateApiSiteOriginServerApi: CommonAPI<
  '/api/site/origin-server',
  'put'
> = (data) => defHttp.put(`/api/site/origin-server`, { data })
